import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'index',
    meta:{
      isTabbar:true,
      keepAlive:true
    },
    component: () => import('@/views/tabbar/index.vue')
  },
  {
    path: '/like',
    name: 'like',
    meta:{
      isTabbar:true,
      keepAlive:true
    },
    component: () => import('@/views/tabbar/like.vue')
  },
  {
    path: '/mine',
    name: 'mine',
    meta:{
      isTabbar:true,
      keepAlive:true
    },
    component: () => import('@/views/tabbar/mine.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/user/login.vue')
  },
  {
    path: '/shop-list',
    name: 'shopList',
    meta: {
      keepAlive: true
    },
    component: () => import('@/views/shop/shop-list.vue')
  },
  {
    path: '/details/:id?',
    name: 'shopDetails',
    props: true,
    component: () => import('@/views/shop/details.vue')
  },
  {
    path: '/music',
    name: 'music',
    meta: {
      isTabbar:true,
      keepAlive: true
    },
    component: () => import('@/views/tabbar/music.vue')
  },
  // {
  //   path: '/music-list',
  //   name: 'musicList',
  //   component: () => import('@/views/music/music-list.vue')
  // },
  {
    path: '/music-details/:id',
    name: 'musicDetails',
    component: () => import('@/views/music/music-details.vue')
  }
];

const router:any = new VueRouter({
  routes
})

export default router
